home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / 2.01 sources / Library-2.01 / Interfaces / script.lisp < prev   
Encoding:
Text File  |  1993-09-16  |  51.8 KB  |  1,267 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :traps)             ; 
  3. ; Created: Tuesday, January 15, 1991 at 8:56 AM
  4. ;     Script.p
  5. ;     Pascal Interface to the Macintosh Libraries
  6. ;         Copyright Apple Computer, Inc.    1986-1990
  7. ;         All rights reserved
  8.  
  9. ;;;;;;;;;;;;;
  10. ;
  11. ; Modification History
  12. ;
  13. ; 04/28/93 mwp Release
  14. ; 04/29/92 bill Typo in #_getdeffontsize
  15. ; ------------- 2.0
  16. ; 10/31/91 bill Bring back some not-in-rom traps.
  17. ; 08/29/91 bill get rid of :invalid-type
  18. ; 08/23/91 bill A few traps did not preserve argument evaluation order.
  19. ;               _FormatX2Str had an :unknown-type.  Change it to :ptr
  20. ;
  21.  
  22. ; $IFC UNDEFINED UsingIncludes
  23. ; $SETC UsingIncludes := 0
  24. ; $ENDC
  25.  
  26. ; $IFC NOT UsingIncludes
  27.  
  28. ; $ENDC
  29.  
  30. ; $IFC UNDEFINED UsingScript
  31. ; $SETC UsingScript := 1
  32.  
  33. ; $I+
  34. ; $SETC ScriptIncludes := UsingIncludes
  35. ; $SETC UsingIncludes := 1
  36. ; $IFC UNDEFINED UsingTypes
  37.  
  38. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  39. ; $ENDC
  40. ; $IFC UNDEFINED UsingOSUtils
  41.  
  42. (require-interface 'OSUTILS)    ; $I $$Shell(PInterfaces)OSUtils.p
  43. ; $ENDC
  44. ; $IFC UNDEFINED UsingQuickdraw
  45.  
  46. (require-interface 'QUICKDRAW)  ; $I $$Shell(PInterfaces)Quickdraw.p
  47. ; $ENDC
  48. ; $SETC UsingIncludes := ScriptIncludes
  49.  
  50. ;  Script System constants 
  51. (defconstant $smSystemScript -1); designates system script.
  52. (defconstant $smCurrentScript -2); designates current font script.
  53.  
  54. (defconstant $smRoman 0)        ; Roman
  55. (defconstant $smJapanese 1)     ; Japanese
  56. (defconstant $smTradChinese 2)  ; Traditional Chinese
  57. (defconstant $smKorean 3)       ; Korean
  58. (defconstant $smArabic 4)       ; Arabic
  59. (defconstant $smHebrew 5)       ; Hebrew
  60. (defconstant $smGreek 6)        ; Greek
  61. (defconstant $smCyrillic 7)     ; Cyrillic
  62. (defconstant $smRSymbol 8)      ; Right-left symbol
  63. (defconstant $smDevanagari 9)   ; Devanagari
  64. (defconstant $smGurmukhi 10)    ; Gurmukhi
  65. (defconstant $smGujarati 11)    ; Gujarati
  66. (defconstant $smOriya 12)       ; Oriya
  67. (defconstant $smBengali 13)     ; Bengali
  68. (defconstant $smTamil 14)       ; Tamil
  69. (defconstant $smTelugu 15)      ; Telugu
  70. (defconstant $smKannada 16)     ; Kannada/Kanarese
  71. (defconstant $smMalayalam 17)   ; Malayalam
  72. (defconstant $smSinhalese 18)   ; Sinhalese
  73. (defconstant $smBurmese 19)     ; Burmese
  74. (defconstant $smKhmer 20)       ; Khmer/Cambodian
  75. (defconstant $smThai 21)        ; Thai
  76. (defconstant $smLaotian 22)     ; Laotian
  77. (defconstant $smGeorgian 23)    ; Georgian
  78. (defconstant $smArmenian 24)    ; Armenian
  79. (defconstant $smSimpChinese 25) ; Simplified Chinese
  80. (defconstant $smTibetan 26)     ; Tibetan
  81. (defconstant $smMongolian 27)   ; Mongolian
  82. (defconstant $smGeez 28)        ; Geez/Ethiopic
  83. (defconstant $smEthiopic 28)    ; Synonym for smGeez
  84. (defconstant $smEastEurRoman 29); Synonym for smSlavic
  85. (defconstant $smVietnamese 30)  ; Vietnamese
  86. (defconstant $smExtArabic 31)   ; extended Arabic
  87. (defconstant $smUninterp 32)    ; uninterpreted symbols, e.g. palette symbols
  88.  
  89. ; Obsolete names for script systems (kept for backward compatibility)
  90. (defconstant $smChinese 2)      ; (use smTradChinese or smSimpChinese)
  91. (defconstant $smRussian 7)      ; (old name for smCyrillic)
  92.  
  93. ;  smMaldivian = 25;                                 (no more smMaldivian!)
  94. (defconstant $smAmharic 28)     ; (old name for smGeez)
  95. (defconstant $smSlavic 29)      ; (old name for smEastEurRoman)
  96. (defconstant $smSindhi 31)      ; (old name for smExtArabic)
  97.  
  98. ;  Calendar Codes 
  99. (defconstant $calGregorian 0)
  100. (defconstant $calArabicCivil 1)
  101. (defconstant $calArabicLunar 2)
  102. (defconstant $calJapanese 3)
  103. (defconstant $calJewish 4)
  104. (defconstant $calCoptic 5)
  105. (defconstant $calPersian 6)
  106.  
  107. ;  Integer Format Codes 
  108. (defconstant $intWestern 0)
  109. (defconstant $intArabic 1)
  110. (defconstant $intRoman 2)
  111. (defconstant $intJapanese 3)
  112. (defconstant $intEuropean 4)
  113. (defconstant $intOutputMask #x8000)
  114.  
  115. ;  CharByte byte types 
  116. (defconstant $smSingleByte 0)
  117. (defconstant $smFirstByte -1)
  118. (defconstant $smLastByte 1)
  119. (defconstant $smMiddleByte 2)
  120.  
  121. ;  CharType field masks 
  122. (defconstant $smcTypeMask #xf)
  123. (defconstant $smcReserved #xf0)
  124. (defconstant $smcClassMask #xf00)
  125. (defconstant $smcOrientationMask #x1000); two-byte script glyph orientation
  126. (defconstant $smcRightMask #x2000)
  127. (defconstant $smcUpperMask #x4000)
  128. (defconstant $smcDoubleMask #x8000)
  129.  
  130. ;  Basic CharType character types 
  131. (defconstant $smCharPunct #x0)
  132. (defconstant $smCharAscii #x1)
  133. (defconstant $smCharEuro #x7)
  134. (defconstant $smCharExtAscii #x7);  More correct synonym for smCharEuro 
  135.  
  136. ;  Additional CharType character types for script systems 
  137. (defconstant $smCharKatakana #x2); Japanese Katakana
  138. (defconstant $smCharHiragana #x3); Japanese Hiragana
  139. (defconstant $smCharIdeographic #x4); Hanzi, Kanji, Hanja
  140. (defconstant $smCharTwoByteGreek #x5); 2-byte Greek in Far East systems
  141. (defconstant $smCharTwoByteRussian #x6); 2-byte Cyrillic in Far East systems
  142. (defconstant $smCharBidirect #x8); Arabic/Hebrew
  143. (defconstant $smCharHangul #xc) ; Korean Hangul
  144. (defconstant $smCharJamo #xd)   ; Korean Jamo
  145.  
  146. ;  old names for above, for backward compatibility 
  147. (defconstant $smCharFISKana #x2); Katakana
  148. (defconstant $smCharFISGana #x3); Hiragana
  149. (defconstant $smCharFISIdeo #x4); Hanzi, Kanji, Hanja
  150. (defconstant $smCharFISGreek #x5); 2-byte Greek in Far East systems
  151. (defconstant $smCharFISRussian #x6); 2-byte Cyrillic in Far East systems
  152.  
  153. ;  CharType classes for punctuation (smCharPunct) 
  154. (defconstant $smPunctNormal #x0)
  155. (defconstant $smPunctNumber #x100)
  156. (defconstant $smPunctSymbol #x200)
  157. (defconstant $smPunctBlank #x300)
  158. (defconstant $smPunctRepeat #x400);  FIS: wildcard 
  159. (defconstant $smPunctGraphic #x500);  FIS: line graphics 
  160.  
  161. ;  CharType classes for FISKana, FISGana 
  162. (defconstant $smKanaSmall #x100); small kana character
  163. (defconstant $smKanaHardOK #x200); can have dakuten
  164. (defconstant $smKanaSoftOK #x300); can have dakuten or han-dakuten
  165.  
  166. ;  CharType Ideographics classes for two-byte systems 
  167. (defconstant $smIdeographicLevel1 #x0); level 1 char
  168. (defconstant $smIdeographicLevel2 #x100); level 2 char
  169. (defconstant $smIdeographicUser #x200); user char
  170.  
  171. ;  old names for above, for backward compatibility 
  172. (defconstant $smFISClassLvl1 #x0); level 1 char
  173. (defconstant $smFISClassLvl2 #x100); level 2 char
  174. (defconstant $smFISClassUser #x200); user char
  175.  
  176. ;  CharType Jamo classes for Korean systems 
  177. (defconstant $smJamoJaeum #x0)  ; simple consonant char
  178. (defconstant $smJamoBogJaeum #x100); complex consonant char
  179. (defconstant $smJamoMoeum #x200); simple vowel char
  180. (defconstant $smJamoBogMoeum #x300); complex vowel char
  181.  
  182. ;  CharType FIS glyph orientation 
  183. (defconstant $smCharHorizontal #x0);  horizontal character form, or for both 
  184. (defconstant $smCharVertical #x1000);  vertical character form 
  185.  
  186. ;  CharType directions 
  187. (defconstant $smCharLeft #x0)
  188. (defconstant $smCharRight #x2000)
  189.  
  190. ;  CharType case modifers 
  191. (defconstant $smCharLower #x0)
  192. (defconstant $smCharUpper #x4000)
  193.  
  194. ;  CharType character size modifiers (1 or multiple bytes). 
  195. (defconstant $smChar1byte #x0)
  196. (defconstant $smChar2byte #x8000)
  197.  
  198. ;  Char2Pixel directions 
  199. (defconstant $smLeftCaret 0)    ; Place caret for left block
  200. (defconstant $smRightCaret -1)  ; Place caret for right block
  201. (defconstant $smHilite 1)       ; Direction is TESysJust
  202.  
  203. ;  Transliterate target types for Roman 
  204. (defconstant $smTransAscii 0)
  205. (defconstant $smTransNative 1)
  206. (defconstant $smTransCase #xfe)
  207. (defconstant $smTransSystem #xff); convert to system script
  208.  
  209. ;  Transliterate target types for FIS 
  210. (defconstant $smTransAscii1 2)  ; 1-byte Roman
  211. (defconstant $smTransAscii2 3)  ; 2-byte Roman
  212. (defconstant $smTransKana1 4)   ; 1-byte Japanese Katakana
  213. (defconstant $smTransKana2 5)   ; 2-byte Japanese Katakana
  214. (defconstant $smTransGana2 7)   ; 2-byte Japanese Hiragana (no 1-byte Hiragana)
  215. (defconstant $smTransHangul2 8) ; 2-byte Korean Hangul
  216. (defconstant $smTransJamo2 9)   ; 2-byte Korean Jamo
  217. (defconstant $smTransBopomofo2 10); 2-byte Chinese Bopomofo
  218.  
  219. ;  Transliterate target modifiers 
  220. (defconstant $smTransLower #x4000)
  221. (defconstant $smTransUpper #x8000)
  222.  
  223. ;  Transliterate source mask - general 
  224. (defconstant $smMaskAll #xffffffff); Convert all text
  225.  
  226. ;  Transliterate source masks 
  227. (defconstant $smMaskAscii #x1)  ; 2^smTransAscii
  228. (defconstant $smMaskNative #x2) ; 2^smTransNative
  229.  
  230. ;  Transliterate source masks for FIS 
  231. (defconstant $smMaskAscii1 #x4) ; 2^smTransAscii1
  232. (defconstant $smMaskAscii2 #x8) ; 2^smTransAscii2
  233. (defconstant $smMaskKana1 #x10) ; 2^smTransKana1
  234. (defconstant $smMaskKana2 #x20) ; 2^smTransKana2
  235. (defconstant $smMaskGana2 #x80) ; 2^smTransGana2
  236. (defconstant $smMaskHangul2 #x100); 2^smTransHangul2
  237. (defconstant $smMaskJamo2 #x200); 2^smTransJamo2
  238. (defconstant $smMaskBopomofo2 #x400); 2^smTransBopomofo2
  239.  
  240. ;  Result values from GetEnvirons, SetEnvirons, GetScript and SetScript calls. 
  241. (defconstant $smNotInstalled 0) ; routine not available in script
  242. (defconstant $smBadVerb -1)     ; Bad verb passed to a routine
  243. (defconstant $smBadScript -2)   ; Bad script code passed to a routine
  244.  
  245. ;  Values for script redraw flag. 
  246. (defconstant $smRedrawChar 0)   ; Redraw character only
  247. (defconstant $smRedrawWord 1)   ; Redraw entire word (2-byte systems)
  248. (defconstant $smRedrawLine -1)  ; Redraw entire line (bidirectional systems)
  249.  
  250. ;  GetEnvirons and SetEnvirons verbs 
  251. (defconstant $smVersion 0)      ; Environment version number
  252. (defconstant $smMunged 2)       ; Globals change count
  253. (defconstant $smEnabled 4)      ; Environment enabled flag
  254. (defconstant $smBidirect 6)     ; At least on bidirect script
  255. (defconstant $smFontForce 8)    ; Force font flag
  256. (defconstant $smIntlForce 10)   ; Force intl flag
  257. (defconstant $smForced 12)      ; script forced to system script
  258. (defconstant $smDefault 14)     ; script defaulted to Roman script
  259. (defconstant $smPrint 16)       ; Printer action routine
  260. (defconstant $smSysScript 18)   ; System script
  261. (defconstant $smLastScript 20)  ; Last keyboard script
  262. (defconstant $smKeyScript 22)   ; Keyboard script
  263. (defconstant $smSysRef 24)      ; System folder refNum
  264. (defconstant $smKeyCache 26)    ; Keyboard table cache pointer
  265. (defconstant $smKeySwap 28)     ; Swapping table pointer
  266. (defconstant $smGenFlags 30)    ; General flags long
  267. (defconstant $smOverride 32)    ; Script override flags
  268. (defconstant $smCharPortion 34) ; Ch vs SpExtra proportion
  269.  
  270. ;  New for System 7.0: 
  271. (defconstant $smDoubleByte 36)  ; Flag for double-byte script installed
  272. (defconstant $smKCHRCache 38)   ; Returns pointer to KCHR cache
  273. (defconstant $smRegionCode 40)  ; Returns current region code (verXxx)
  274.  
  275. ;  GetScript and SetScript verbs.
  276. ; Note: Verbs private to script systems are negative, while
  277. ; those general across script systems are non-negative. 
  278. (defconstant $smScriptVersion 0); Script software version
  279. (defconstant $smScriptMunged 2) ; Script entry changed count
  280. (defconstant $smScriptEnabled 4); Script enabled flag
  281. (defconstant $smScriptRight 6)  ; Right to left flag
  282. (defconstant $smScriptJust 8)   ; Justification flag
  283. (defconstant $smScriptRedraw 10); Word redraw flag
  284. (defconstant $smScriptSysFond 12); Preferred system font
  285. (defconstant $smScriptAppFond 14); Preferred Application font
  286. (defconstant $smScriptBundle 16); Beginning of itlb verbs
  287. (defconstant $smScriptNumber 16); Script itl0 id
  288. (defconstant $smScriptDate 18)  ; Script itl1 id
  289. (defconstant $smScriptSort 20)  ; Script itl2 id
  290. (defconstant $smScriptFlags 22) ; flags word
  291. (defconstant $smScriptToken 24) ; Script itl4 id
  292. (defconstant $smScriptEncoding 26); id of optional itl5, if present
  293. (defconstant $smScriptLang 28)  ; Current language for script
  294. (defconstant $smScriptNumDate 30); Script KCHR id
  295. (defconstant $smScriptKeys 32)  ; Script KEYC id from dictionary
  296. (defconstant $smScriptIcon 34)  ; ID # of SICN or kcs#/kcs4/kcs8 suite
  297. (defconstant $smScriptPrint 36) ; Script printer action routine
  298. (defconstant $smScriptTrap 38)  ; Trap entry pointer
  299. (defconstant $smScriptCreator 40); Script file creator
  300. (defconstant $smScriptFile 42)  ; Script file name
  301. (defconstant $smScriptName 44)  ; Script name
  302.  
  303. ;  There is a hole here for old Kanji private verbs 46-76 
  304. ;  New for System 7.0: 
  305. (defconstant $smScriptMonoFondSize 78); default monospace FOND (hi) & size (lo)
  306. (defconstant $smScriptPrefFondSize 80); preferred FOND (hi) & size (lo)
  307. (defconstant $smScriptSmallFondSize 82); default small FOND (hi) & size (lo)
  308. (defconstant $smScriptSysFondSize 84); default system FOND (hi) & size (lo)
  309. (defconstant $smScriptAppFondSize 86); default app FOND (hi) & size (lo)
  310. (defconstant $smScriptHelpFondSize 88); default Help Mgr FOND (hi) & size (lo)
  311. (defconstant $smScriptValidStyles 90); mask of valid styles for script
  312. (defconstant $smScriptAliasStyle 92); style (set) to use for aliases
  313.  
  314. ;  Negative verbs for KeyScript 
  315. (defconstant $smKeyNextScript -1);  Switch to next available script 
  316. (defconstant $smKeySysScript -2);  Switch to the system script 
  317. (defconstant $smKeySwapScript -3);  Switch to previously-used script 
  318.  
  319. ;  New for System 7.0: 
  320. (defconstant $smKeyNextKybd -4) ;  Switch to next keyboard in current script 
  321. (defconstant $smKeySwapKybd -5) ;  Switch to previously-used keyboard in current keyscript 
  322.  
  323. (defconstant $smKeyDisableKybds -6);  Disable keyboards not in system or Roman script 
  324. (defconstant $smKeyEnableKybds -7);  Re-enable keyboards for all enabled scripts 
  325. (defconstant $smKeyToggleInline -8);  Toggle inline input for current keyscript 
  326. (defconstant $smKeyToggleDirection -9);  Toggle default line direction (TESysJust) 
  327. (defconstant $smKeyNextInputMethod -10);  Switch to next input method in current keyscript 
  328. (defconstant $smKeySwapInputMethod -11);  Switch to last-used input method in current keyscript 
  329.  
  330. (defconstant $smKeyDisableKybdSwitch -12);  Disable switching from the current keyboard 
  331.  
  332. ;  Bits in the smScriptFlags word
  333. ; (bits above 7 are non-static) 
  334. (defconstant $smsfIntellCP 0)   ; script has intellegent cut & paste
  335. (defconstant $smsfSingByte 1)   ; script has only single bytes
  336. (defconstant $smsfNatCase 2)    ; native chars have upper & lower case
  337. (defconstant $smsfContext 3)    ; contextual script (e.g. AIS-based)
  338. (defconstant $smsfNoForceFont 4); Will not force characters
  339. (defconstant $smsfB0Digits 5)   ; Has alternate digits at B0-B9
  340. (defconstant $smsfAutoInit 6)   ; auto initialize the script
  341. (defconstant $smsfForms 13)     ; Uses contextual forms for letters
  342. (defconstant $smsfLigatures 14) ; Uses contextual ligatures
  343. (defconstant $smsfReverse 15)   ; Reverses native text, right-left
  344.  
  345. ;  Bits in the smGenFlags long.
  346. ; First (high-order) byte is set from itlc flags byte. 
  347. (defconstant $smfShowIcon 31)   ; Show icon even if only one script
  348. (defconstant $smfDualCaret 30)  ; Use dual caret for mixed direction text
  349. (defconstant $smfNameTagEnab 29); Reserved for internal use
  350.  
  351. ;  Roman script constants 
  352. ;  The following are here for backward compatibility, but should not be used. 
  353. ;  This information should be obtained using GetScript. 
  354. (defconstant $romanSysFond #x3fff); system font id number
  355. (defconstant $romanAppFond 3)   ; application font id number
  356. (defconstant $romanFlags #x7)   ; roman settings
  357.  
  358. ;  Script Manager font equates. 
  359. (defconstant $smFondStart #x4000); start from 16K
  360. (defconstant $smFondEnd #xc000) ; past end of range at 48K
  361.  
  362. ;  Miscellaneous font equates. 
  363. (defconstant $smUprHalfCharSet #x80); first char code in top half of std char set
  364.  
  365. ;  Character Set Extensions 
  366. (defconstant $diaeresisUprY #xd9)
  367. (defconstant $fraction #xda)
  368. (defconstant $intlCurrency #xdb)
  369. (defconstant $leftSingGuillemet #xdc)
  370. (defconstant $rightSingGuillemet #xdd)
  371. (defconstant $fiLigature #xde)
  372. (defconstant $flLigature #xdf)
  373. (defconstant $dblDagger #xe0)
  374. (defconstant $centeredDot #xe1)
  375. (defconstant $baseSingQuote #xe2)
  376. (defconstant $baseDblQuote #xe3)
  377. (defconstant $perThousand #xe4)
  378. (defconstant $circumflexUprA #xe5)
  379. (defconstant $circumflexUprE #xe6)
  380. (defconstant $acuteUprA #xe7)
  381. (defconstant $diaeresisUprE #xe8)
  382. (defconstant $graveUprE #xe9)
  383. (defconstant $acuteUprI #xea)
  384. (defconstant $circumflexUprI #xeb)
  385. (defconstant $diaeresisUprI #xec)
  386. (defconstant $graveUprI #xed)
  387. (defconstant $acuteUprO #xee)
  388. (defconstant $circumflexUprO #xef)
  389. (defconstant $appleLogo #xf0)
  390. (defconstant $graveUprO #xf1)
  391. (defconstant $acuteUprU #xf2)
  392. (defconstant $circumflexUprU #xf3)
  393. (defconstant $graveUprU #xf4)
  394. (defconstant $dotlessLwrI #xf5)
  395. (defconstant $circumflex #xf6)
  396. (defconstant $tilde #xf7)
  397. (defconstant $macron #xf8)
  398. (defconstant $breveMark #xf9)
  399. (defconstant $overDot #xfa)
  400. (defconstant $ringMark #xfb)
  401. (defconstant $cedilla #xfc)
  402. (defconstant $doubleAcute #xfd)
  403. (defconstant $ogonek #xfe)
  404. (defconstant $hachek #xff)
  405.  
  406. ;  String2Date status values 
  407. (defconstant $fatalDateTime #x8000)
  408. (defconstant $longDateFound 1)
  409. (defconstant $leftOverChars 2)
  410. (defconstant $sepNotIntlSep 4)
  411. (defconstant $fieldOrderNotIntl 8)
  412. (defconstant $extraneousStrings 16)
  413. (defconstant $tooManySeps 32)
  414. (defconstant $sepNotConsistent 64)
  415. (defconstant $tokenErr #x8100)
  416. (defconstant $cantReadUtilities #x8200)
  417. (defconstant $dateTimeNotFound #x8400)
  418. (defconstant $dateTimeInvalid #x8800)
  419.  
  420. ;  TokenType values 
  421. (defconstant $tokenIntl 4)      ; the itl resource number of the tokenizer
  422. (defconstant $tokenEmpty -1)
  423. (defconstant $tokenUnknown 0)
  424. (defconstant $tokenWhite 1)
  425. (defconstant $tokenLeftLit 2)
  426. (defconstant $tokenRightLit 3)
  427. (defconstant $tokenAlpha 4)
  428. (defconstant $tokenNumeric 5)
  429. (defconstant $tokenNewLine 6)
  430. (defconstant $tokenLeftComment 7)
  431. (defconstant $tokenRightComment 8)
  432. (defconstant $tokenLiteral 9)
  433. (defconstant $tokenEscape 10)
  434. (defconstant $tokenAltNum 11)
  435. (defconstant $tokenRealNum 12)
  436. (defconstant $tokenAltReal 13)
  437. (defconstant $tokenReserve1 14)
  438. (defconstant $tokenReserve2 15)
  439. (defconstant $tokenLeftParen 16)
  440. (defconstant $tokenRightParen 17)
  441. (defconstant $tokenLeftBracket 18)
  442. (defconstant $tokenRightBracket 19)
  443. (defconstant $tokenLeftCurly 20)
  444. (defconstant $tokenRightCurly 21)
  445. (defconstant $tokenLeftEnclose 22)
  446. (defconstant $tokenRightEnclose 23)
  447. (defconstant $tokenPlus 24)
  448. (defconstant $tokenMinus 25)
  449. (defconstant $tokenAsterisk 26)
  450. (defconstant $tokenDivide 27)
  451. (defconstant $tokenPlusMinus 28)
  452. (defconstant $tokenSlash 29)
  453. (defconstant $tokenBackSlash 30)
  454. (defconstant $tokenLess 31)
  455. (defconstant $tokenGreat 32)
  456. (defconstant $tokenEqual 33)
  457. (defconstant $tokenLessEqual2 34)
  458. (defconstant $tokenLessEqual1 35)
  459. (defconstant $tokenGreatEqual2 36)
  460. (defconstant $tokenGreatEqual1 37)
  461. (defconstant $token2Equal 38)
  462. (defconstant $tokenColonEqual 39)
  463. (defconstant $tokenNotEqual 40)
  464. (defconstant $tokenLessGreat 41)
  465. (defconstant $tokenExclamEqual 42)
  466. (defconstant $tokenExclam 43)
  467. (defconstant $tokenTilde 44)
  468. (defconstant $tokenComma 45)
  469. (defconstant $tokenPeriod 46)
  470. (defconstant $tokenLeft2Quote 47)
  471. (defconstant $tokenRight2Quote 48)
  472. (defconstant $tokenLeft1Quote 49)
  473. (defconstant $tokenRight1Quote 50)
  474. (defconstant $token2Quote 51)
  475. (defconstant $token1Quote 52)
  476. (defconstant $tokenSemicolon 53)
  477. (defconstant $tokenPercent 54)
  478. (defconstant $tokenCaret 55)
  479. (defconstant $tokenUnderline 56)
  480. (defconstant $tokenAmpersand 57)
  481. (defconstant $tokenAtSign 58)
  482. (defconstant $tokenBar 59)
  483. (defconstant $tokenQuestion 60)
  484. (defconstant $tokenPi 61)
  485. (defconstant $tokenRoot 62)
  486. (defconstant $tokenSigma 63)
  487. (defconstant $tokenIntegral 64)
  488. (defconstant $tokenMicro 65)
  489. (defconstant $tokenCapPi 66)
  490. (defconstant $tokenInfinity 67)
  491. (defconstant $tokenColon 68)
  492. (defconstant $tokenHash 69)
  493. (defconstant $tokenDollar 70)
  494. (defconstant $tokenNoBreakSpace 71)
  495. (defconstant $tokenFraction 72)
  496. (defconstant $tokenIntlCurrency 73)
  497. (defconstant $tokenLeftSingGuillemet 74)
  498. (defconstant $tokenRightSingGuillemet 75)
  499. (defconstant $tokenPerThousand 76)
  500. (defconstant $tokenEllipsis 77)
  501. (defconstant $tokenCenterDot 78)
  502. (defconstant $tokenNil 127)
  503. (defconstant $delimPad -2)
  504.  
  505. ;  obsolete, misspelled token names kept for backward compatibility 
  506. (defconstant $tokenTilda 44)
  507. (defconstant $tokenCarat 55)
  508.  
  509. ;  the NumberParts indices 
  510. (defconstant $tokLeftQuote 1)
  511. (defconstant $tokRightQuote 2)
  512. (defconstant $tokLeadPlacer 3)
  513. (defconstant $tokLeader 4)
  514. (defconstant $tokNonLeader 5)
  515. (defconstant $tokZeroLead 6)
  516. (defconstant $tokPercent 7)
  517. (defconstant $tokPlusSign 8)
  518. (defconstant $tokMinusSign 9)
  519. (defconstant $tokThousands 10)
  520. (defconstant $tokSeparator 12)  ; 11 is a reserved field
  521. (defconstant $tokEscape 13)
  522. (defconstant $tokDecPoint 14)
  523. (defconstant $tokEPlus 15)
  524. (defconstant $tokEMinus 16)
  525. (defconstant $tokMaxSymbols 31)
  526. (defconstant $curNumberPartsVersion 1); current version of NumberParts record
  527. (defconstant $fVNumber 0)       ; first version of NumFormatString
  528.  
  529. ;  Date equates 
  530. (defconstant $smallDateBit 31)  ; Restrict valid date/time to range of Time global
  531. (defconstant $togChar12HourBit 30); If toggling hour by char, accept hours 1..12 only
  532. (defconstant $togCharZCycleBit 29); Modifier for togChar12HourBit: accept hours 0..11 only
  533. (defconstant $togDelta12HourBit 28); If toggling hour up/down, restrict to 12-hour range (am/pm)
  534. (defconstant $genCdevRangeBit 27); Restrict date/time to range used by genl CDEV
  535. (defconstant $validDateFields -1)
  536. (defconstant $maxDateField 10)
  537. (defconstant $eraMask #x1)
  538. (defconstant $yearMask #x2)
  539. (defconstant $monthMask #x4)
  540. (defconstant $dayMask #x8)
  541. (defconstant $hourMask #x10)
  542. (defconstant $minuteMask #x20)
  543. (defconstant $secondMask #x40)
  544. (defconstant $dayOfWeekMask #x80)
  545. (defconstant $dayOfYearMask #x100)
  546. (defconstant $weekOfYearMask #x200)
  547. (defconstant $pmMask #x400)
  548. (defconstant $dateStdMask #x7f)
  549.  
  550. ;  Toggle results 
  551. (defconstant $toggleUndefined 0)
  552. (defconstant $toggleOK 1)
  553. (defconstant $toggleBadField 2)
  554. (defconstant $toggleBadDelta 3)
  555. (defconstant $toggleBadChar 4)
  556. (defconstant $toggleUnknown 5)
  557. (defconstant $toggleBadNum 6)
  558. (defconstant $toggleOutOfRange 7); synonym for toggleErr3
  559. (defconstant $toggleErr3 7)
  560. (defconstant $toggleErr4 8)
  561. (defconstant $toggleErr5 9)
  562.  
  563. ;  Constants for truncWhere argument in TruncString and TruncText 
  564. (defconstant $smTruncEnd 0)     ;  Truncate at end 
  565. (defconstant $smTruncMiddle #x4000);  Truncate in middle 
  566.  
  567. ;  Constants for TruncString and TruncText results 
  568. (defconstant $smNotTruncated 0) ;  No truncation was necessary 
  569. (defconstant $smTruncated 1)    ;  Truncation performed 
  570. (defconstant $smTruncErr -1)    ;  General error 
  571.  
  572. ; Constants for styleRunPosition argument in NPortionText, NDrawJust,
  573. ;  NMeasureJust, NChar2Pixel, and NPixel2Char.
  574. (defconstant $smOnlyStyleRun 0) ;  This is the only style run on the line
  575. (defconstant $smLeftStyleRun 1) ;  This is leftmost of multiple style runs on the line
  576. (defconstant $smRightStyleRun 2);  This is rightmost of multiple style runs on the line
  577. (defconstant $smMiddleStyleRun 3);  There are multiple style runs on the line and this
  578. ;  is neither the leftmost nor the rightmost. 
  579.  
  580. (def-mactype :tokenresults (find-mactype :unsigned-byte))
  581. (defconstant $tokenOK 0)
  582. (defconstant $tokenOverflow 1)
  583. (defconstant $stringOverflow 2)
  584. (defconstant $badDelim 3)
  585. (defconstant $badEnding 4)
  586. (defconstant $crash 5)
  587.  
  588. (def-mactype :longdatefield (find-mactype :unsigned-word))
  589. (defconstant $eraField 0)
  590. (defconstant $yearField 1)
  591. (defconstant $monthField 2)
  592. (defconstant $dayField 3)
  593. (defconstant $hourField 4)
  594. (defconstant $minuteField 5)
  595. (defconstant $secondField 6)
  596. (defconstant $dayOfWeekField 7)
  597. (defconstant $dayOfYearField 8)
  598. (defconstant $weekOfYearField 9)
  599. (defconstant $pmField 10)
  600. (defconstant $res1Field 11)
  601. (defconstant $res2Field 12)
  602. (defconstant $res3Field 13)
  603.  
  604. (def-mactype :styledlinebreakcode (find-mactype :unsigned-byte))
  605. (defconstant $smBreakWord 0)
  606. (defconstant $smBreakChar 1)
  607. (defconstant $smBreakOverflow 2)
  608.  
  609. (def-mactype :formatclass (find-mactype :unsigned-byte))
  610. (defconstant $fPositive 0)
  611. (defconstant $fNegative 1)
  612. (defconstant $fZero 2)
  613.  
  614. (def-mactype :formatresulttype (find-mactype :unsigned-word))
  615. (defconstant $fFormatOK 0)
  616. (defconstant $fBestGuess 1)
  617. (defconstant $fOutOfSynch 2)
  618. (defconstant $fSpuriousChars 3)
  619. (defconstant $fMissingDelimiter 4)
  620. (defconstant $fExtraDecimal 5)
  621. (defconstant $fMissingLiteral 6)
  622. (defconstant $fExtraExp 7)
  623. (defconstant $fFormatOverflow 8)
  624. (defconstant $fFormStrIsNAN 9)
  625. (defconstant $fBadPartsTable 10)
  626. (defconstant $fExtraPercent 11)
  627. (defconstant $fExtraSeparator 12)
  628. (defconstant $fEmptyFormatString 13)
  629.  
  630. (defrecord CharByteTable (array (array :signed-byte 256)))
  631. (def-mactype :toggleresults (find-mactype :signed-integer))
  632.  
  633. (def-mactype :breaktableptr (find-mactype :pointer))
  634. (defrecord BreakTable 
  635.    (charTypes (:array :signed-byte 256))
  636.    (tripleLength :signed-integer)
  637.    (triples (:array :signed-integer 1))
  638.    )
  639.  
  640. ;  New NBreakTable for System 7.0: 
  641. (def-mactype :nbreaktableptr (find-mactype :pointer))
  642. (defrecord NBreakTable 
  643.    (flags1 :signed-byte)
  644.    (flags2 :signed-byte)
  645.    (version :signed-integer)
  646.    (classTableOff :signed-integer)
  647.    (auxCTableOff :signed-integer)
  648.    (backwdTableOff :signed-integer)
  649.    (forwdTableOff :signed-integer)
  650.    (doBackup :signed-integer)
  651.    (reserved :signed-integer)
  652.    (charTypes (:array :signed-byte 256))
  653.    (tables (:array :signed-integer 1))
  654.    )
  655.  
  656. (defrecord OffPair 
  657.    (offFirst :signed-integer)
  658.    (offSecond :signed-integer)
  659.    )
  660.  
  661. (defrecord OffsetTable (array (array :offpair 3)))
  662.  
  663. (defrecord ItlcRecord 
  664.    (itlcSystem :signed-integer) ; default system script
  665.    (itlcReserved :signed-integer); reserved
  666.    (itlcFontForce :signed-byte) ; default font force flag
  667.    (itlcIntlForce :signed-byte) ; default intl force flag
  668.    (itlcOldKybd :signed-byte)   ; old keyboard
  669.    (itlcFlags :signed-byte)     ; general flags
  670.    (itlcIconOffset :signed-integer); script icon offset
  671.    (itlcIconSide :signed-byte)  ; icon side
  672.    (itlcIconRsvd :signed-byte)  ; rsvd for other icon info
  673.    (itlcRegionCode :signed-integer); preferred verXxx code
  674.    (itlcReserved3 (:array :signed-byte 34)); for future use
  675.    )
  676.  
  677. (defrecord ItlbRecord 
  678.    (itlbNumber :signed-integer) ; itl0 id number
  679.    (itlbDate :signed-integer)   ; itl1 id number
  680.    (itlbSort :signed-integer)   ; itl2 id number
  681.    (itlbFlags :signed-integer)  ; Script flags
  682.    (itlbToken :signed-integer)  ; itl4 id number
  683.    (itlbEncoding :signed-integer); itl5 ID # (optional; char encoding)
  684.    (itlbLang :signed-integer)   ; cur language for script 
  685.    (itlbNumRep :signed-byte)    ; number representation code
  686.    (itlbDateRep :signed-byte)   ; date representation code 
  687.    (itlbKeys :signed-integer)   ; KCHR id number
  688.    (itlbIcon :signed-integer)   ; ID # of SICN or kcs#/kcs4/kcs8 suite.
  689.    )
  690.  
  691. ;  New ItlbExtRecord structure for System 7.0 
  692. (DEFRECORD ITLBEXTRECORD (BASE :ITLBRECORD)
  693.   (ITLBLOCALSIZE :SIGNED-LONG)
  694.   (ITLBMONOFOND :SIGNED-INTEGER)
  695.   (ITLBMONOSIZE :SIGNED-INTEGER)
  696.   (ITLBPREFFOND :SIGNED-INTEGER)
  697.   (ITLBPREFSIZE :SIGNED-INTEGER)
  698.   (ITLBSMALLFOND :SIGNED-INTEGER)
  699.   (ITLBSMALLSIZE :SIGNED-INTEGER)
  700.   (ITLBSYSFOND :SIGNED-INTEGER)
  701.   (ITLBSYSSIZE :SIGNED-INTEGER)
  702.   (ITLBAPPFOND :SIGNED-INTEGER)
  703.   (ITLBAPPSIZE :SIGNED-INTEGER)
  704.   (ITLBHELPFOND :SIGNED-INTEGER)
  705.   (ITLBHELPSIZE :SIGNED-INTEGER)
  706.   (FILLER1 :SIGNED-BYTE)
  707.   (ITLBVALIDSTYLES :UNSIGNED-BYTE)
  708.   (FILLER2 :SIGNED-BYTE)
  709.   (ITLBALIASSTYLE :UNSIGNED-BYTE))
  710.  
  711. (defrecord MachineLocation 
  712.    (latitude :signed-long)
  713.    (longitude :signed-long)
  714.    (:variant 
  715.  
  716.       ((dlsDelta :signed-byte)) ; signed byte; daylight savings delta
  717.  
  718.       ((gmtDelta :signed-long)) ; must mask - see documentation
  719.       ))
  720.  
  721. (def-mactype :string2datestatus (find-mactype :signed-integer))
  722. (def-mactype :tokentype (find-mactype :signed-integer))
  723. (defrecord DelimType (array (array :signed-integer 2)))
  724. (defrecord CommentType (array (array :signed-integer 4)))
  725.  
  726. (def-mactype :tokenrecptr (find-mactype :pointer))
  727. (defrecord TokenRec 
  728.    (theToken :signed-integer)
  729.    (position :pointer)          ; pointer into original Source
  730.    (length :signed-long)        ; length of text in original source
  731.    (stringPosition (:pointer (:string 255))); Pascal/C string copy of identifier
  732.    )
  733.  
  734. (def-mactype :tokenblockptr (find-mactype :pointer))
  735. (defrecord TokenBlock 
  736.    (source :pointer)            ; pointer to stream of characters
  737.    (sourceLength :signed-long)  ; length of source stream
  738.    (tokenList :pointer)         ; pointer to array of tokens
  739.    (tokenLength :signed-long)   ; maximum length of TokenList
  740.    (tokenCount :signed-long)    ; number tokens generated by tokenizer
  741.    (stringList :pointer)        ; pointer to stream of identifiers
  742.    (stringLength :signed-long)  ; length of string list
  743.    (stringCount :signed-long)   ; number of bytes currently used
  744.    (doString :boolean)          ; make strings & put into StringLIst
  745.    (doAppend :boolean)          ; append to TokenList rather than replace
  746.    (doAlphanumeric :boolean)    ; identifiers may include numeric
  747.    (doNest :boolean)            ; do comments nest?
  748.    (leftDelims (:array :signed-integer 2))
  749.    (rightDelims (:array :signed-integer 2))
  750.    (leftComment (:array :signed-integer 4))
  751.    (rightComment (:array :signed-integer 4))
  752.    (escapeCode :signed-integer) ; escape symbol code
  753.    (decimalCode :signed-integer)
  754.    (itlResource :handle)        ; ptr to itl4 resource of current script
  755.    (reserved (:array :signed-long 8)); must be zero!
  756.    )
  757.  
  758. (def-mactype :untokentableptr (find-mactype :pointer))
  759. (def-mactype :untokentablehandle (find-mactype :handle))
  760. (defrecord (UntokenTable :handle) 
  761.    (len :signed-integer)
  762.    (lastToken :signed-integer)
  763.    (index (:array :signed-integer 256)); index table; last = lastToken
  764.    )
  765.  
  766. (def-mactype :datecacheptr (find-mactype :pointer))
  767. (defrecord DateCacheRecord 
  768.    (hidden (:array :signed-integer 256)); only for temporary use
  769.    )
  770.  
  771. (defrecord longdatetime (data :comp))
  772.  
  773. (defrecord LongDateCvt 
  774.    (:variant 
  775.  
  776.       ((c :longdatetime))
  777.  
  778.       ((lHigh :signed-long)
  779.       (lLow :signed-long))
  780.       ))
  781.  
  782. (defrecord LongDateRec 
  783.    (:variant 
  784.  
  785.       ((era :signed-integer)
  786.       (year :signed-integer)
  787.       (month :signed-integer)
  788.       (day :signed-integer)
  789.       (hour :signed-integer)
  790.       (minute :signed-integer)
  791.       (second :signed-integer)
  792.       (dayOfWeek :signed-integer)
  793.       (dayOfYear :signed-integer)
  794.       (weekOfYear :signed-integer)
  795.       (pm :signed-integer)
  796.       (res1 :signed-integer)
  797.       (res2 :signed-integer)
  798.       (res3 :signed-integer))
  799.  
  800.       ((list (:array :signed-integer 14))); Index by LongDateField!
  801.  
  802.       ((eraAlt :signed-integer)
  803.       (oldDate :datetimerec))
  804.       ))
  805.  
  806. (def-mactype :datedelta (find-mactype :signed-byte))
  807.  
  808. (defrecord TogglePB 
  809.    (togFlags :signed-long)      ; caller normally sets low word to dateStdMask=$7F
  810.    (amChars :ostype)            ; from intl0
  811.    (pmChars :ostype)            ; from intl0
  812.    (reserved (:array :signed-long 4))
  813.    )
  814.  
  815. (defrecord FormatOrder (array (array :signed-integer 1)))
  816. (def-mactype :formatorderptr (find-mactype :pointer))
  817. (def-mactype :formatstatus (find-mactype :signed-integer))
  818.  
  819. (defrecord WideChar 
  820.    (:variant 
  821.  
  822.       ((a (:array :character 2))); 0 is the high order character
  823.  
  824.       ((b :signed-integer))
  825.       ))
  826.  
  827. (defrecord WideCharArr 
  828.    (size :signed-integer)
  829.    (data (:array :widechar 10))
  830.    )
  831.  
  832. (defrecord NumFormatString 
  833.    (fLength :unsigned-byte)
  834.    (fVersion :unsigned-byte)
  835.    (data (:array :signed-byte 254)); private data
  836.    )
  837.  
  838. (def-mactype :itl4ptr (find-mactype :pointer))
  839. (def-mactype :itl4handle (find-mactype :handle))
  840. (defrecord (Itl4Rec :handle) 
  841.    (flags :signed-integer)
  842.    (resourceType :signed-long)
  843.    (resourceNum :signed-integer)
  844.    (version :signed-integer)
  845.    (resHeader1 :signed-long)
  846.    (resHeader2 :signed-long)
  847.    (numTables :signed-integer)  ; one-based
  848.    (mapOffset :signed-long)     ; offsets are from record start
  849.    (strOffset :signed-long)
  850.    (fetchOffset :signed-long)
  851.    (unTokenOffset :signed-long)
  852.    (defPartsOffset :signed-long)
  853.    (resOffset6 :signed-long)
  854.    (resOffset7 :signed-long)
  855.    (resOffset8 :signed-long)
  856.    )
  857.  
  858. ;  New NItl4Rec for System 7.0: 
  859. (def-mactype :nitl4ptr (find-mactype :pointer))
  860. (def-mactype :nitl4handle (find-mactype :handle))
  861. (defrecord (NItl4Rec :handle) 
  862.    (flags :signed-integer)
  863.    (resourceType :signed-long)
  864.    (resourceNum :signed-integer)
  865.    (version :signed-integer)
  866.    (format :signed-integer)
  867.    (resHeader :signed-integer)
  868.    (resHeader2 :signed-long)
  869.    (numTables :signed-integer)  ; one-based
  870.    (mapOffset :signed-long)     ; offsets are from record start
  871.    (strOffset :signed-long)
  872.    (fetchOffset :signed-long)
  873.    (unTokenOffset :signed-long)
  874.    (defPartsOffset :signed-long)
  875.    (whtSpListOffset :signed-long)
  876.    (resOffset7 :signed-long)
  877.    (resOffset8 :signed-long)
  878.    (resLength1 :signed-integer)
  879.    (resLength2 :signed-integer)
  880.    (resLength3 :signed-integer)
  881.    (unTokenLength :signed-integer)
  882.    (defPartsLength :signed-integer)
  883.    (whtSpListLength :signed-integer)
  884.    (resLength7 :signed-integer)
  885.    (resLength8 :signed-integer)
  886.    )
  887.  
  888. (def-mactype :numberpartsptr (find-mactype :pointer))
  889. (defrecord NumberParts 
  890.    (version :signed-integer)
  891.    (data (:array :widechar 31)) ; index by [tokLeftQuote..tokMaxSymbols]
  892.    (pePlus :widechararr)
  893.    (peMinus :widechararr)
  894.    (peMinusPlus :widechararr)
  895.    (altNumTable :widechararr)
  896.    (reserved (:array :character 20))
  897.    )
  898.  
  899. (defrecord FVector 
  900.    (start :signed-integer)
  901.    (length :signed-integer)
  902.    )
  903.  
  904. (defrecord TripleInt (array (array :fvector 3)));  index by [fPositive..fZero] 
  905.  
  906. (DEFRECORD SCRIPTRUNSTATUS (SCRIPT :SIGNED-BYTE) (VAR :SIGNED-BYTE))
  907.  
  908. ;  type for truncWhere parameter in new TruncString, TruncText 
  909. (def-mactype :trunccode (find-mactype :signed-integer))
  910.  
  911. ;  type for styleRunPosition parameter in NPixel2Char etc. 
  912. (def-mactype :juststylecode (find-mactype :signed-integer))
  913.  
  914.  
  915. (deftrap _fontscript nil
  916.    (:stack :signed-integer)
  917.    (:stack-trap #xA8B5 ((+ (ash 33280 16) 0) :signed-longint)))
  918.  
  919. (deftrap _intlscript nil
  920.    (:stack :signed-integer)
  921.    (:stack-trap #xA8B5 ((+ (ash 33280 16) 2) :signed-longint)))
  922.  
  923. (deftrap _keyscript ((code :signed-integer))
  924.    nil
  925.    (:stack-trap #xA8B5 code ((+ (ash 32770 16) 4) :signed-longint)))
  926.  
  927. (deftrap _font2script ((fontnumber :signed-integer))
  928.    (:stack :signed-integer)
  929.    (:stack-trap #xA8B5 fontnumber ((+ (ash 33282 16) 6) :signed-longint)))
  930.  
  931. (deftrap _getenvirons ((verb :signed-integer))
  932.    (:stack :signed-long)
  933.    (:stack-trap #xA8B5 verb ((+ (ash 33794 16) 8) :signed-longint)))
  934.  
  935. (deftrap _setenvirons ((verb :signed-integer) (param :signed-long))
  936.    (:stack :signed-integer)
  937.    (:stack-trap #xA8B5 verb param ((+ (ash 33286 16) 10) :signed-longint)))
  938.  
  939. (deftrap _getscript ((script :signed-integer) (verb :signed-integer))
  940.    (:stack :signed-long)
  941.    (:stack-trap #xA8B5 script verb ((+ (ash 33796 16) 12) :signed-longint)))
  942.  
  943. (deftrap _setscript ((script :signed-integer) (verb :signed-integer) (param :signed-long))
  944.    (:stack :signed-integer)
  945.    (:stack-trap #xA8B5 script verb param ((+ (ash 33288 16) 14) :signed-longint)))
  946.  
  947. (deftrap _charbyte ((textbuf :pointer) (textoffset :signed-integer))
  948.    (:stack :signed-integer)
  949.    (:stack-trap #xA8B5 textbuf textoffset ((+ (ash 33286 16) 16) :signed-longint)))
  950.  
  951. (deftrap _chartype ((textbuf :pointer) (textoffset :signed-integer))
  952.    (:stack :signed-integer)
  953.    (:stack-trap #xA8B5 textbuf textoffset ((+ (ash 33286 16) 18) :signed-longint)))
  954.  
  955. (deftrap _pixel2char ((textbuf :pointer) (textlen :signed-integer) (slop :signed-integer) (pixelwidth :signed-integer) (leadingedge (:pointer :boolean)))
  956.    (:stack :signed-integer)
  957.    (:stack-trap #xA8B5 textbuf textlen slop pixelwidth leadingedge ((+ (ash 33294 16) 20) :signed-longint)))
  958.  
  959. (deftrap _char2pixel ((textbuf :pointer) (textlen :signed-integer) (slop :signed-integer) (offset :signed-integer) (direction :signed-integer))
  960.    (:stack :signed-integer)
  961.    (:stack-trap #xA8B5 textbuf textlen slop offset direction ((+ (ash 33292 16) 22) :signed-longint)))
  962.  
  963. (deftrap _transliterate ((srchandle :handle) (dsthandle :handle) (target :signed-integer) (srcmask :signed-long))
  964.    (:stack :signed-integer)
  965.    (:stack-trap #xA8B5 srchandle dsthandle target srcmask ((+ (ash 33294 16) 24) :signed-longint)))
  966.  
  967. (deftrap _findword ((textptr :pointer) (textlength :signed-integer) (offset :signed-integer) (leadingedge :boolean) (breaks (:pointer :breaktable)) (offsets (:pointer :offsettable)))
  968.    nil
  969.    (:stack-trap #xA8B5 textptr textlength offset leadingedge breaks offsets ((+ (ash 32786 16) 26) :signed-longint)))
  970.  
  971. (deftrap _hilitetext ((textptr :pointer) (textlength :signed-integer) (firstoffset :signed-integer) (secondoffset :signed-integer) (offsets (:pointer :offsettable)))
  972.    nil
  973.    (:stack-trap #xA8B5 textptr textlength firstoffset secondoffset offsets ((+ (ash 32782 16) 28) :signed-longint)))
  974.  
  975. (deftrap _drawjust ((textptr :pointer) (textlength :signed-integer) (slop :signed-integer))
  976.    nil
  977.    (:stack-trap #xA8B5 textptr textlength slop ((+ (ash 32776 16) 30) :signed-longint)))
  978.  
  979. (deftrap _measurejust ((textptr :pointer) (textlength :signed-integer) (slop :signed-integer) (charlocs :pointer))
  980.    nil
  981.    (:stack-trap #xA8B5 textptr textlength slop charlocs ((+ (ash 32780 16) 32) :signed-longint)))
  982.  
  983. (deftrap _parsetable ((table (:pointer :charbytetable)))
  984.    (:stack :boolean)
  985.    (:stack-trap #xA8B5 table ((+ (ash 33284 16) 34) :signed-longint)))
  986.  
  987. (deftrap _getdeffontsize nil
  988.    (:no-trap :signed-integer)
  989.    (:no-trap (let ((fsize (%get-word (%int-to-ptr 2894))))
  990.                (if (eql fsize 0) 12 fsize))))
  991.  
  992. (deftrap _getsysfont nil
  993.    (:no-trap :signed-integer)
  994.    (:no-trap (%get-signed-word (%int-to-ptr 2982))))
  995.  
  996. (deftrap _getappfont nil
  997.    (:no-trap :signed-integer)
  998.    (:no-trap (%get-signed-word (%int-to-ptr 2436))))
  999.  
  1000. (deftrap _getmbarheight nil
  1001.    (:no-trap :signed-integer)
  1002.    (:no-trap (%get-signed-word (%int-to-ptr 2986))))
  1003.  
  1004. (deftrap _getsysjust nil
  1005.    (:no-trap :signed-integer)
  1006.    (:no-trap (%get-signed-word (%int-to-ptr 2988))))
  1007.  
  1008. (deftrap _setsysjust ((newjust :signed-integer))
  1009.    nil
  1010.    (:no-trap (%put-word (%int-to-ptr 2988) newjust)))
  1011.  
  1012. (deftrap _readlocation ((loc (:pointer :machinelocation)))
  1013.    nil
  1014.    (:register-trap #xA051 :a0 loc :d0 #x000c00E4))
  1015.  
  1016. (deftrap _writelocation ((loc :machinelocation))
  1017.    nil
  1018.    (:register-trap #xA052 :a0 loc :d0 #x000c00E4))
  1019.  
  1020. (deftrap _uprtext ((textptr :pointer) (len :signed-integer))
  1021.    nil
  1022.    (:register-trap #xA054 :a0 textptr :d0 len))
  1023.  
  1024. (deftrap _lwrtext ((textptr :pointer) (len :signed-integer))
  1025.    nil
  1026.    (:register-trap #xA056 :a0 textptr :d0 len))
  1027.  
  1028. ;   New for 7.0  
  1029.  
  1030. (deftrap _lowertext ((textptr :pointer) (len :signed-integer))
  1031.    nil
  1032.    (:register-trap #xA056 :a0 textptr :d0 len))
  1033.  
  1034. (deftrap _striptext ((textptr :pointer) (len :signed-integer))
  1035.    nil
  1036.    (:register-trap #xA256 :a0 textptr :d0 len))
  1037.  
  1038. (deftrap _uppertext ((textptr :pointer) (len :signed-integer))
  1039.    nil
  1040.    (:register-trap #xA456 :a0 textptr :d0 len))
  1041.  
  1042. (deftrap _stripuppertext ((textptr :pointer) (len :signed-integer))
  1043.    nil
  1044.    (:register-trap #xA656 :a0 textptr :d0 len))
  1045.  
  1046.  
  1047. (deftrap _styledlinebreak ((textptr :pointer) (textlen :signed-long) (textstart :signed-long) (textend :signed-long) (flags :signed-long) (textwidth (:pointer :signed-long)) (textoffset (:pointer :signed-long)))
  1048.    (:stack :unsigned-byte)
  1049.    (:stack-trap #xA8B5 textptr textlen textstart textend flags textwidth textoffset ((+ (ash 33308 16) 65534) :signed-longint)))
  1050.  
  1051. (deftrap _getformatorder ((ordering (:pointer :formatorder)) (firstformat :signed-integer) (lastformat :signed-integer) (lineright :boolean) (rldirproc :pointer) (dirparam :pointer))
  1052.    nil
  1053.    (:stack-trap #xA8B5 ordering firstformat lastformat lineright rldirproc dirparam ((+ (ash 32786 16) 65532) :signed-longint)))
  1054.  
  1055. (deftrap _intltokenize ((tokenparam (:pointer :tokenblock)))
  1056.    (:stack :unsigned-byte)
  1057.    (:stack-trap #xA8B5 tokenparam ((+ (ash 33284 16) 65530) :signed-longint)))
  1058.  
  1059. (deftrap _initdatecache ((thecache (:pointer :datecacherecord)))
  1060.    (:stack :signed-integer)
  1061.    (:stack-trap #xA8B5 thecache ((+ (ash 33284 16) 65528) :signed-longint)))
  1062.  
  1063. (deftrap _string2date ((textptr :pointer) (textlen :signed-long) (thecache (:pointer :datecacherecord)) (lengthused (:pointer :signed-long)) (datetime (:pointer :longdaterec)))
  1064.    (:stack :signed-integer)
  1065.    (:stack-trap #xA8B5 textptr textlen thecache lengthused datetime ((+ (ash 33300 16) 65526) :signed-longint)))
  1066.  
  1067. (deftrap _string2time ((textptr :pointer) (textlen :signed-long) (thecache (:pointer :datecacherecord)) (lengthused (:pointer :signed-long)) (datetime (:pointer :longdaterec)))
  1068.    (:stack :signed-integer)
  1069.    (:stack-trap #xA8B5 textptr textlen thecache lengthused datetime ((+ (ash 33300 16) 65524) :signed-longint)))
  1070.  
  1071. (deftrap _longdate2secs ((ldate :longdaterec) (lsecs (:pointer :longdatetime)))
  1072.    nil
  1073.    (:stack-trap #xA8B5 ldate lsecs ((+ (ash 32776 16) 65522) :signed-longint)))
  1074.  
  1075. (deftrap _longsecs2date ((lsecs (:pointer :longdatetime)) (ldate (:pointer :longdaterec)))
  1076.    nil
  1077.    (:stack-trap #xA8B5 lsecs ldate ((+ (ash 32776 16) 65520) :signed-longint)))
  1078.  
  1079. (deftrap _toggledate ((lsecs (:pointer :longdatetime)) (field :unsigned-word) (delta :signed-byte) (ch :signed-integer) (params :togglepb))
  1080.    (:stack :signed-integer)
  1081.    (:stack-trap #xA8B5 lsecs field delta ch params ((+ (ash 33294 16) 65518) :signed-longint)))
  1082.  
  1083. (deftrap _str2format ((instring (:string 255)) (partstable :numberparts) (outstring (:pointer :numformatstring)))
  1084.    (:stack :signed-integer)
  1085.    (:stack-trap #xA8B5 instring partstable outstring ((+ (ash 33292 16) 65516) :signed-longint)))
  1086.  
  1087. (deftrap _format2str ((mycanonical :numformatstring) (partstable :numberparts) (outstring (:pointer (:string 255))) (positions (:pointer :tripleint)))
  1088.    (:stack :signed-integer)
  1089.    (:stack-trap #xA8B5 mycanonical partstable outstring positions ((+ (ash 33296 16) 65514) :signed-longint)))
  1090.  
  1091. (deftrap _formatx2str ((x :pointer) (mycanonical :numformatstring) (partstable :numberparts) (outstring (:pointer (:string 255))))
  1092.    (:stack :signed-integer)
  1093.    (:stack-trap #xA8B5 x mycanonical partstable outstring ((+ (ash 33296 16) 65512) :signed-longint)))
  1094.  
  1095. (deftrap _formatstr2x ((source (:string 255)) (mycanonical :numformatstring) (partstable :numberparts) (x :pointer))
  1096.    (:stack :signed-integer)
  1097.    (:stack-trap #xA8B5 source mycanonical partstable x ((+ (ash 33296 16) 65510) :signed-longint)))
  1098.  
  1099. (deftrap _portiontext ((textptr :pointer) (textlen :signed-long))
  1100.    (:stack :signed-long)
  1101.    (:stack-trap #xA8B5 textptr textlen ((+ (ash 33800 16) 36) :signed-longint)))
  1102.  
  1103. (deftrap _findscriptrun ((textptr :pointer) (textlen :signed-long) (lenused (:pointer :signed-long)))
  1104.    (:stack :scriptrunstatus)
  1105.    (:stack-trap #xA8B5 textptr textlen lenused ((+ (ash 33292 16) 38) :signed-longint)))
  1106.  
  1107. (deftrap _visiblelength ((textptr :pointer) (textlen :signed-long))
  1108.    (:stack :signed-long)
  1109.    (:stack-trap #xA8B5 textptr textlen ((+ (ash 33800 16) 40) :signed-longint)))
  1110.  
  1111. (deftrap _validdate ((vdate (:pointer :longdaterec)) (flags :signed-long) (newsecs (:pointer :longdatetime)))
  1112.    (:stack :signed-integer)
  1113.    (:stack-trap #xA8B5 vdate flags newsecs ((+ (ash 33284 16) 65508) :signed-longint)))
  1114.  
  1115. ;   New for 7.0  
  1116.  
  1117. (deftrap _nfindword ((textptr :pointer) (textlength :signed-integer) (offset :signed-integer) (leadingedge :boolean) (nbreaks (:pointer :nbreaktable)) (offsets (:pointer :offsettable)))
  1118.    nil
  1119.    (:stack-trap #xA8B5 textptr textlength offset leadingedge nbreaks offsets ((+ (ash 32786 16) 65506) :signed-longint)))
  1120.  
  1121. (deftrap _truncstring ((width :signed-integer) (thestring (:pointer (:string 255))) (truncwhere :signed-integer))
  1122.    (:stack :signed-integer)
  1123.    (:stack-trap #xA8B5 width thestring truncwhere ((+ (ash 33288 16) 65504) :signed-longint)))
  1124.  
  1125. (deftrap _trunctext ((width :signed-integer) (textptr :pointer) (length (:pointer :signed-integer)) (truncwhere :signed-integer))
  1126.    (:stack :signed-integer)
  1127.    (:stack-trap #xA8B5 width textptr length truncwhere ((+ (ash 33292 16) 65502) :signed-longint)))
  1128.  
  1129. (deftrap _replacetext ((basetext :handle) (substitutiontext :handle) (key (:string 15)))
  1130.    (:stack :signed-integer)
  1131.    (:stack-trap #xA8B5 basetext substitutiontext key ((+ (ash 33292 16) 65500) :signed-longint)))
  1132.  
  1133. (deftrap _npixel2char ((textbuf :pointer) (textlen :signed-long) (slop :signed-long) (pixelwidth :signed-long) (leadingedge (:pointer :boolean)) (widthremaining (:pointer :signed-long)) (stylerunposition :signed-integer) (numer :point) (denom :point))
  1134.    (:stack :signed-integer)
  1135.    (:stack-trap #xA8B5 textbuf textlen slop pixelwidth leadingedge widthremaining stylerunposition numer denom ((+ (ash 33314 16) 46) :signed-longint)))
  1136.  
  1137. (deftrap _nchar2pixel ((textbuf :pointer) (textlen :signed-long) (slop :signed-long) (offset :signed-long) (direction :signed-integer) (stylerunposition :signed-integer) (numer :point) (denom :point))
  1138.    (:stack :signed-integer)
  1139.    (:stack-trap #xA8B5 textbuf textlen slop offset direction stylerunposition numer denom ((+ (ash 33308 16) 48) :signed-longint)))
  1140.  
  1141. (deftrap _ndrawjust ((textptr :pointer) (textlength :signed-long) (slop :signed-long) (stylerunposition :signed-integer) (numer :point) (denom :point))
  1142.    nil
  1143.    (:stack-trap #xA8B5 textptr textlength slop stylerunposition numer denom ((+ (ash 32790 16) 50) :signed-longint)))
  1144.  
  1145. (deftrap _nmeasurejust ((textptr :pointer) (textlength :signed-long) (slop :signed-long) (charlocs :pointer) (stylerunposition :signed-integer) (numer :point) (denom :point))
  1146.    nil
  1147.    (:stack-trap #xA8B5 textptr textlength slop charlocs stylerunposition numer denom ((+ (ash 32794 16) 52) :signed-longint)))
  1148.  
  1149. (deftrap _nportiontext ((textptr :pointer) (textlen :signed-long) (stylerunposition :signed-integer) (numer :point) (denom :point))
  1150.    (:stack :signed-long)
  1151.    (:stack-trap #xA8B5 textptr textlen stylerunposition numer denom ((+ (ash 33810 16) 54) :signed-longint)))
  1152.  
  1153. ; $ENDC                         ;  UsingScript 
  1154.  
  1155. ; $IFC NOT UsingIncludes
  1156.  
  1157. ; $ENDC
  1158.  
  1159.  
  1160. (export '($femptyformatstring $fextraseparator $fextrapercent $fbadpartstable
  1161.           $fformstrisnan $fformatoverflow $fextraexp $fmissingliteral
  1162.           $fextradecimal $fmissingdelimiter $fspuriouschars $foutofsynch
  1163.           $fbestguess $fformatok $fzero $fnegative $fpositive $smbreakoverflow
  1164.           $smbreakchar $smbreakword $res3field $res2field $res1field $pmfield
  1165.           $weekofyearfield $dayofyearfield $dayofweekfield $secondfield
  1166.           $minutefield $hourfield $dayfield $monthfield $yearfield $erafield
  1167.           $crash $badending $baddelim $stringoverflow $tokenoverflow $tokenok
  1168.           $smmiddlestylerun $smrightstylerun $smleftstylerun $smonlystylerun
  1169.           $smtruncerr $smtruncated $smnottruncated $smtruncmiddle $smtruncend
  1170.           $toggleerr5 $toggleerr4 $toggleerr3 $toggleoutofrange $togglebadnum
  1171.           $toggleunknown $togglebadchar $togglebaddelta $togglebadfield
  1172.           $toggleok $toggleundefined $datestdmask $pmmask $weekofyearmask
  1173.           $dayofyearmask $dayofweekmask $secondmask $minutemask $hourmask
  1174.           $daymask $monthmask $yearmask $eramask $maxdatefield $validdatefields
  1175.           $gencdevrangebit $togdelta12hourbit $togcharzcyclebit
  1176.           $togchar12hourbit $smalldatebit $fvnumber $curnumberpartsversion
  1177.           $tokmaxsymbols $tokeminus $tokeplus $tokdecpoint $tokescape
  1178.           $tokseparator $tokthousands $tokminussign $tokplussign $tokpercent
  1179.           $tokzerolead $toknonleader $tokleader $tokleadplacer $tokrightquote
  1180.           $tokleftquote $tokencarat $tokentilda $delimpad $tokennil
  1181.           $tokencenterdot $tokenellipsis $tokenperthousand
  1182.           $tokenrightsingguillemet $tokenleftsingguillemet $tokenintlcurrency
  1183.           $tokenfraction $tokennobreakspace $tokendollar $tokenhash $tokencolon
  1184.           $tokeninfinity $tokencappi $tokenmicro $tokenintegral $tokensigma
  1185.           $tokenroot $tokenpi $tokenquestion $tokenbar $tokenatsign
  1186.           $tokenampersand $tokenunderline $tokencaret $tokenpercent
  1187.           $tokensemicolon $token1quote $token2quote $tokenright1quote
  1188.           $tokenleft1quote $tokenright2quote $tokenleft2quote $tokenperiod
  1189.           $tokencomma $tokentilde $tokenexclam $tokenexclamequal
  1190.           $tokenlessgreat $tokennotequal $tokencolonequal $token2equal
  1191.           $tokengreatequal1 $tokengreatequal2 $tokenlessequal1 $tokenlessequal2
  1192.           $tokenequal $tokengreat $tokenless $tokenbackslash $tokenslash
  1193.           $tokenplusminus $tokendivide $tokenasterisk $tokenminus $tokenplus
  1194.           $tokenrightenclose $tokenleftenclose $tokenrightcurly $tokenleftcurly
  1195.           $tokenrightbracket $tokenleftbracket $tokenrightparen $tokenleftparen
  1196.           $tokenreserve2 $tokenreserve1 $tokenaltreal $tokenrealnum
  1197.           $tokenaltnum $tokenescape $tokenliteral $tokenrightcomment
  1198.           $tokenleftcomment $tokennewline $tokennumeric $tokenalpha
  1199.           $tokenrightlit $tokenleftlit $tokenwhite $tokenunknown $tokenempty
  1200.           $tokenintl $datetimeinvalid $datetimenotfound $cantreadutilities
  1201.           $tokenerr $sepnotconsistent $toomanyseps $extraneousstrings
  1202.           $fieldordernotintl $sepnotintlsep $leftoverchars $longdatefound
  1203.           $fataldatetime $hachek $ogonek $doubleacute $cedilla $ringmark
  1204.           $overdot $brevemark $macron $tilde $circumflex $dotlesslwri
  1205.           $graveupru $circumflexupru $acuteupru $graveupro $applelogo
  1206.           $circumflexupro $acuteupro $graveupri $diaeresisupri $circumflexupri
  1207.           $acuteupri $graveupre $diaeresisupre $acuteupra $circumflexupre
  1208.           $circumflexupra $perthousand $basedblquote $basesingquote
  1209.           $centereddot $dbldagger $flligature $filigature $rightsingguillemet
  1210.           $leftsingguillemet $intlcurrency $fraction $diaeresisupry
  1211.           $smuprhalfcharset $smfondend $smfondstart $romanflags $romanappfond
  1212.           $romansysfond $smfnametagenab $smfdualcaret $smfshowicon $smsfreverse
  1213.           $smsfligatures $smsfforms $smsfautoinit $smsfb0digits
  1214.           $smsfnoforcefont $smsfcontext $smsfnatcase $smsfsingbyte
  1215.           $smsfintellcp $smkeydisablekybdswitch $smkeyswapinputmethod
  1216.           $smkeynextinputmethod $smkeytoggledirection $smkeytoggleinline
  1217.           $smkeyenablekybds $smkeydisablekybds $smkeyswapkybd $smkeynextkybd
  1218.           $smkeyswapscript $smkeysysscript $smkeynextscript $smscriptaliasstyle
  1219.           $smscriptvalidstyles $smscripthelpfondsize $smscriptappfondsize
  1220.           $smscriptsysfondsize $smscriptsmallfondsize $smscriptpreffondsize
  1221.           $smscriptmonofondsize $smscriptname $smscriptfile $smscriptcreator
  1222.           $smscripttrap $smscriptprint $smscripticon $smscriptkeys
  1223.           $smscriptnumdate $smscriptlang $smscriptencoding $smscripttoken
  1224.           $smscriptflags $smscriptsort $smscriptdate $smscriptnumber
  1225.           $smscriptbundle $smscriptappfond $smscriptsysfond $smscriptredraw
  1226.           $smscriptjust $smscriptright $smscriptenabled $smscriptmunged
  1227.           $smscriptversion $smregioncode $smkchrcache $smdoublebyte
  1228.           $smcharportion $smoverride $smgenflags $smkeyswap $smkeycache
  1229.           $smsysref $smkeyscript $smlastscript $smsysscript $smprint $smdefault
  1230.           $smforced $smintlforce $smfontforce $smbidirect $smenabled $smmunged
  1231.           $smversion $smredrawline $smredrawword $smredrawchar $smbadscript
  1232.           $smbadverb $smnotinstalled $smmaskbopomofo2 $smmaskjamo2
  1233.           $smmaskhangul2 $smmaskgana2 $smmaskkana2 $smmaskkana1 $smmaskascii2
  1234.           $smmaskascii1 $smmasknative $smmaskascii $smmaskall $smtransupper
  1235.           $smtranslower $smtransbopomofo2 $smtransjamo2 $smtranshangul2
  1236.           $smtransgana2 $smtranskana2 $smtranskana1 $smtransascii2
  1237.           $smtransascii1 $smtranssystem $smtranscase $smtransnative
  1238.           $smtransascii $smhilite $smrightcaret $smleftcaret $smchar2byte
  1239.           $smchar1byte $smcharupper $smcharlower $smcharright $smcharleft
  1240.           $smcharvertical $smcharhorizontal $smjamobogmoeum $smjamomoeum
  1241.           $smjamobogjaeum $smjamojaeum $smfisclassuser $smfisclasslvl2
  1242.           $smfisclasslvl1 $smideographicuser $smideographiclevel2
  1243.           $smideographiclevel1 $smkanasoftok $smkanahardok $smkanasmall
  1244.           $smpunctgraphic $smpunctrepeat $smpunctblank $smpunctsymbol
  1245.           $smpunctnumber $smpunctnormal $smcharfisrussian $smcharfisgreek
  1246.           $smcharfisideo $smcharfisgana $smcharfiskana $smcharjamo
  1247.           $smcharhangul $smcharbidirect $smchartwobyterussian
  1248.           $smchartwobytegreek $smcharideographic $smcharhiragana
  1249.           $smcharkatakana $smcharextascii $smchareuro $smcharascii $smcharpunct
  1250.           $smcdoublemask $smcuppermask $smcrightmask $smcorientationmask
  1251.           $smcclassmask $smcreserved $smctypemask $smmiddlebyte $smlastbyte
  1252.           $smfirstbyte $smsinglebyte $intoutputmask $inteuropean $intjapanese
  1253.           $introman $intarabic $intwestern $calpersian $calcoptic $caljewish
  1254.           $caljapanese $calarabiclunar $calarabiccivil $calgregorian $smsindhi
  1255.           $smslavic $smamharic $smrussian $smchinese $smuninterp $smextarabic
  1256.           $smvietnamese $smeasteurroman $smethiopic $smgeez $smmongolian
  1257.           $smtibetan $smsimpchinese $smarmenian $smgeorgian $smlaotian $smthai
  1258.           $smkhmer $smburmese $smsinhalese $smmalayalam $smkannada $smtelugu
  1259.           $smtamil $smbengali $smoriya $smgujarati $smgurmukhi $smdevanagari
  1260.           $smrsymbol $smcyrillic $smgreek $smhebrew $smarabic $smkorean
  1261.           $smtradchinese $smjapanese $smroman $smcurrentscript $smsystemscript))
  1262. (provide-interface 'script)
  1263.